repeated string hackerrank solution